package aml.bs.commons;

import aml.bs.spring.SpringCtxHolder;
import aml.bs.spring.SpringNacosCtxHolder;

/**
 * @Title: NacosClient
 * @Author duxuqiang02
 * @Date 2023/9/17 13:13
 * @description: Nacos静态获取配置
 */
public class NacosClient {
    private static final SpringNacosCtxHolder nacosCtxHolder;
    static {
        nacosCtxHolder = SpringCtxHolder.getBean(SpringNacosCtxHolder.class);
    }

    public static String getConfig(String dataId,String defaultValue){
        return nacosCtxHolder.getValue(dataId,defaultValue);
    }

    public static String getConfig(String dataId){
        return nacosCtxHolder.getValue(dataId);
    }
}
